package com.pmcc.cj.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 任务表
 * Created by tomas on 2020/10/11.
 */
@Entity
@Table(name = "cj_task")
public class CjTask extends UUIDEntity {
    @Column(name = "robot_task_id")
    private String robotTaskId;//特质订单转移过来的
    @Column(name = "order_id")
    private String orderId;//从订单表转移过来的
    //订单状态 0：特质订单 1：云飞防订单   2：云商城订单
    @Column(name = "fettle")
    private Integer fettle;
    @Column(name = "robot_id")
    private String robotId;//机手id
    @Column(name = "customer_id")
    private String customerId;//发布人id
    @Column(name = "customer_name")
    private String customerName;//发布人姓名
    @Column(name = "cellphone")
    private String cellphone;//发布人电话

    //任务状态  0：待执行   1：已完成
    @Column(name = "fettle_task")
    private Integer fettleTask;

    //是否需要确认状态（如果是云飞防推送的需要确认）  0：需要    1：不需要
    @Column(name = "fettle_type")
    private Integer fettleType;
    private String province;//省
    @Column(name = "city")
    private String city;//市
    @Column(name = "county")
    private String county;//县
    @Column(name = "township")
    private String township;//乡
    @Column(name = "village")
    private String village;//村
    @Column(name = "address")
    private String address;//详细地址
    @Column(name = "salesman_id")
    private String salesmanId;//零售商id
    @Column(name = "xx")
    private Double xx;//发布人经度坐标
    @Column(name = "yy")
    private Double yy;//发布人纬度坐标
    @Column(name = "money")
    private BigDecimal money;//订单金额（单价）
    @Column(name = "number")
    private Double number;//亩数（最小值50）
    @Column(name = "total_money")
    private BigDecimal totalMoney;//总金额
    @Column(name = "crop_type")
    private String cropType;//农作物类型（不给字典，小麦玉米等名字）
    @Column(name = "medicine_type")
    private String medicineType;//药剂类型（文本，汉字）
    @Column(name = "begin_time")
    private Date beginTime;//作业时间
    @Column(name = "cycle_time")
    private Integer cycleTime;//预计周期 （天）
    @Column(name = "remark")
    private String remark;//订单备注
    @Column(name = "create_time")
    private Date createTime;
    @Column(name = "yun_id")
    private String yunId;// 套餐ID
    @Column(name = "yun_name")
    private String yunName;// 套餐名称
    @Column(name = "yun_detail",length = 2000)
    private String yunDetail;// 套餐详细
    @Column(name = "robot_confirm")
    private Integer robotConfirm;//机手完成作业确认 0：未确认   1：确认
    @Column(name = "robot_confirm_time")
    private Date robotConfirmTime;//机手确认时间
    @Column(name = "robot_flag")
    private String robotFlag;//0:未领取    1：领取    这个状态是给扫面二维码之后机手领取的



    @Transient
    private String salemanName;//零售商姓名
    @Transient
    private String salemanPhone;//零售商电话
    @Transient
    private String salemanAddress;//零售商地址

    public String getSalemanAddress() {
        return salemanAddress;
    }

    public void setSalemanAddress(String salemanAddress) {
        this.salemanAddress = salemanAddress;
    }

    public String getSalemanName() {
        return salemanName;
    }

    public void setSalemanName(String salemanName) {
        this.salemanName = salemanName;
    }

    public String getSalemanPhone() {
        return salemanPhone;
    }

    public void setSalemanPhone(String salemanPhone) {
        this.salemanPhone = salemanPhone;
    }

    public Integer getFettleType() {
        return fettleType;
    }

    public void setFettleType(Integer fettleType) {
        this.fettleType = fettleType;
    }

    public String getRobotTaskId() {
        return robotTaskId;
    }

    public void setRobotTaskId(String robotTaskId) {
        this.robotTaskId = robotTaskId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Integer getFettle() {
        return fettle;
    }

    public void setFettle(Integer fettle) {
        this.fettle = fettle;
    }

    public String getRobotId() {
        return robotId;
    }

    public void setRobotId(String robotId) {
        this.robotId = robotId;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public Integer getFettleTask() {
        return fettleTask;
    }

    public void setFettleTask(Integer fettleTask) {
        this.fettleTask = fettleTask;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getTownship() {
        return township;
    }

    public void setTownship(String township) {
        this.township = township;
    }

    public String getVillage() {
        return village;
    }

    public void setVillage(String village) {
        this.village = village;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSalesmanId() {
        return salesmanId;
    }

    public void setSalesmanId(String salesmanId) {
        this.salesmanId = salesmanId;
    }

    public Double getXx() {
        return xx;
    }

    public void setXx(Double xx) {
        this.xx = xx;
    }

    public Double getYy() {
        return yy;
    }

    public void setYy(Double yy) {
        this.yy = yy;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Double getNumber() {
        return number;
    }

    public void setNumber(Double number) {
        this.number = number;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public String getCropType() {
        return cropType;
    }

    public void setCropType(String cropType) {
        this.cropType = cropType;
    }

    public String getMedicineType() {
        return medicineType;
    }

    public void setMedicineType(String medicineType) {
        this.medicineType = medicineType;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Integer getCycleTime() {
        return cycleTime;
    }

    public void setCycleTime(Integer cycleTime) {
        this.cycleTime = cycleTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getYunId() {
        return yunId;
    }

    public void setYunId(String yunId) {
        this.yunId = yunId;
    }

    public String getYunName() {
        return yunName;
    }

    public void setYunName(String yunName) {
        this.yunName = yunName;
    }

    public String getYunDetail() {
        return yunDetail;
    }

    public void setYunDetail(String yunDetail) {
        this.yunDetail = yunDetail;
    }

    public Integer getRobotConfirm() {
        return robotConfirm;
    }

    public void setRobotConfirm(Integer robotConfirm) {
        this.robotConfirm = robotConfirm;
    }

    @JsonSerialize(using = DateTimeFormat.class)
    public Date getRobotConfirmTime() {
        return robotConfirmTime;
    }

    public void setRobotConfirmTime(Date robotConfirmTime) {
        this.robotConfirmTime = robotConfirmTime;
    }

    public String getRobotFlag() {
        return robotFlag;
    }

    public void setRobotFlag(String robotFlag) {
        this.robotFlag = robotFlag;
    }
}
